<template>
	<view>
		<view class="frame"></view>
		<text class="invationCods">邀请码</text>
		<input class="inputCode" type="text" v-model="input" placeholder="填写邀请人的邀请码"/>
		<view class="submit" @click="tijiao">
		    提交
		</view>
	</view>
</template>

<script>
	import Require from '@/common/require.js';
	export default {
		data() {
			return {
				input:''
			};
		},
		methods:{
			tijiao(){
				var self=this
				Require.commonRequest({
					url: '/api/member/bindinviter',
					data:{
						inviter_num:self.input
					},
					success: function(ret) {
						if(ret.data.code==200){
							uni.showToast({
								icon: 'none',
								title: ret.data.msg,
							});
							setTimeout(function(){
								uni.navigateTo({
									url:"invitedBy"
								})
							},1500)
						}else{
							uni.showToast({
								icon: 'none',
								title: ret.data.msg,
							});
						}
					},
					fail: function() {
						uni.showToast({
							icon: "none",
							title: "网络异常，请稍后再试"
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss">
      .frame{
		  display: block;
		  width:10rpx;
		  height:30rpx;
		  background:rgba(115,34,216,1);
		  border-radius:5rpx;
		  position: absolute;
		  top: 30rpx;
		  left: 20rpx;
	  }
      .invationCods{
		  font-size:28rpx;
		  font-family:PingFang SC;
		  font-weight:400;
		  color:rgba(51,51,51,1);
		  position: absolute;
		  top: 25rpx;
		  left: 42rpx;
	  }
	  .inputCode{
		  width:690rpx;
		  height:100rpx;
		  background:rgba(255,255,255,1);
		  border-radius:10rpx;
		  font-size:28rpx;
		  // border: 1rpx solid red;
		  position: absolute;
		  top: 90rpx;
		  left: 20rpx;
		  padding-left: 20rpx;
		  }
		  .submit{
			  width:710rpx;
			  height:90rpx;
			  background:rgba(115,34,216,1);
			  box-shadow:0rpx 0rpx 18rpx 2rpx rgba(115,34,216,0.3);
			  opacity:0.5;
			  border-radius:20rpx;
			  font-size:38rpx;
			  font-family:PingFang SC;
			  font-weight:bold;
			  color:rgba(255,255,255,1);
			  display: flex;
			  justify-content: center;
			  align-items: center;
			  position: absolute;
			  top: 270rpx;
			  left: 20rpx;
			  }
</style>
